<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>帮助</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="styles.css">
<script src="responsive-nav.js"></script>
<script src="jquery.min.js"></script>
</head>
<body>

<div role="navigation" id="foo" class="nav-collapse">
  <ul>
	<li class="active"><a href="#">介绍</a></li>
	<li><a href="#">安装</a></li>
	<li><a href="#">使用</a></li>
  </ul>
</div>

<div role="main" class="main">
  <a href="#nav" class="nav-toggle">Menu</a>
<div id="id_helps">
<div>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>

<?php
  error_reporting(E_ALL^E_DEPRECATED);

  define('DB_HOST', 'localhost');    // mysql地址
  define('DB_USER', 'root');         // mysql用户名
  define('DB_PASS', '123456');       // mysql密码
  define('DB_DATABASENAME', 'regi'); // mysql数据库名称

  $conn = mysql_connect(DB_HOST, DB_USER, DB_PASS); // 连接mysql
  if (!$conn) {
    die('不能连接数据库: ' . mysql_error());
    return false;
  }
  $ret = mysql_select_db(DB_DATABASENAME); // 选择mysql数据库
  if (!$ret) {
    $ret = mysql_query("CREATE DATABASE regi");
    if (!$ret) {
      die('创建数据库regi失败: ' . mysql_error());
      return false;
    }
    $ret = mysql_select_db(DB_DATABASENAME);
    if (!$ret) {
      die('打开数据库regi失败: ' . mysql_error());
      return false;
    }
  }
  echo "成功打开数据库: regi";
  echo "";

//  phpinfo(); // 显示php信息

?>
</div>
<div style="display:none;">
</div>
<div style="display:none;">
</div>
</div>
    </div>

<script>
var nav = responsiveNav("foo", {customToggle: ".nav-toggle"});

	$('#foo li').click(function(){
		$('#foo li').removeClass("active");
		$(this).addClass("active");
		alert($(this).index());
		$('#id_helps').children().hide();
		$('#id_helps').children().eq($(this).index()).show();
	});

</script>

</body>
</html>
